using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BCodeItemMap : EntityTypeConfiguration<t_BCodeItem>
    {
        public t_BCodeItemMap()
        {
            // Primary Key
            this.HasKey(t => t.FBCodeItemId);

            // Properties
            this.Property(t => t.FBCodeItemId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBCodeItemName)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FBCodeItemName_CHT)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FBCodeItemName_EN)
                .IsRequired()
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("t_BCodeItem");
            this.Property(t => t.FBCodeItemId).HasColumnName("FBCodeItemId");
            this.Property(t => t.FBCodeItemName).HasColumnName("FBCodeItemName");
            this.Property(t => t.FBCodeItemName_CHT).HasColumnName("FBCodeItemName_CHT");
            this.Property(t => t.FBCodeItemName_EN).HasColumnName("FBCodeItemName_EN");
            this.Property(t => t.FBCodeType).HasColumnName("FBCodeType");
            this.Property(t => t.FItemClassID).HasColumnName("FItemClassID");
        }
    }
}
